<?php

namespace App\Exports;

use App\Models\Accounting\AccountingImportTemplate;
use Maatwebsite\Excel\Concerns\FromArray;

class AccountingTemplateExport implements FromArray
{
    public $tableName;

    public function __construct($tableName)
    {
        $this->tableName = $tableName;
    }

    public function array(): array
    {
        return [AccountingImportTemplate::query()->where('table_name', $this->tableName)->pluck('column_name')->toArray()];
    }
}
